import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/home_room_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class HomeRoomEntity {
	late int code;
	late HomeRoomObj obj;
	late String msg;

	HomeRoomEntity();

	factory HomeRoomEntity.fromJson(Map<String, dynamic> json) => $HomeRoomEntityFromJson(json);

	Map<String, dynamic> toJson() => $HomeRoomEntityToJson(this);

	HomeRoomEntity copyWith({int? code, HomeRoomObj? obj, String? msg}) {
		return HomeRoomEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeRoomObj {
	late List<HomeRoomObjList> list;

	HomeRoomObj();

	factory HomeRoomObj.fromJson(Map<String, dynamic> json) => $HomeRoomObjFromJson(json);

	Map<String, dynamic> toJson() => $HomeRoomObjToJson(this);

	HomeRoomObj copyWith({List<HomeRoomObjList>? list}) {
		return HomeRoomObj()
			..list= list ?? this.list;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeRoomObjList {
	late int roomId;
	late String cityName;
	late String communityName;
	late String buildingName;
	late String unitName;
	late String roomName;

	HomeRoomObjList();

	factory HomeRoomObjList.fromJson(Map<String, dynamic> json) => $HomeRoomObjListFromJson(json);

	Map<String, dynamic> toJson() => $HomeRoomObjListToJson(this);

	HomeRoomObjList copyWith({int? roomId, String? cityName, String? communityName, String? buildingName, String? unitName, String? roomName}) {
		return HomeRoomObjList()
			..roomId= roomId ?? this.roomId
			..cityName= cityName ?? this.cityName
			..communityName= communityName ?? this.communityName
			..buildingName= buildingName ?? this.buildingName
			..unitName= unitName ?? this.unitName
			..roomName= roomName ?? this.roomName;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}